home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Rpm / AdministerMonitorServer.asp < prev    next >
Encoding:
Text File  |  2003-06-24  |  16.0 KB  |  447 lines

  1. <html>
  2. <head>
  3. <title>MonitorIT Server Log</title>
  4.  
  5. <link rel="stylesheet" type="text/css" href="css/rpmstyle.css">
  6. <style>
  7. #MonMainBox { border: none;  background-color : activeborder; position:absolute; margin:0; height:100%; width:100% }
  8.  
  9. #MonTextBox { border-style : solid; border-width : 1px; overflow : scroll;  background-color:white; }
  10. #MonTextBox { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  11. #MonTextBox { position:absolute; margin:0; top:48; left:4; }
  12.  
  13.  
  14. #StMainBox { border: solid 0px graytext; border-top : one; background-color : activeborder; height: 30px; position:absolute; margin:0; top:505}
  15. #StMainBox { border-left-color : #E8E8E8; }
  16. </style>
  17. </head>
  18.  
  19. <body class="bodyc" scroll=no style="margin:3px; overflow: none" language="JavaScript" RPMHostIP="!BreakoutBot:MonitorIP!" RPMHostPort="!BreakoutBot:MonitorPort!" RPMUserName="!BreakoutBot:UserName!" BOBDone="!BreakoutBot:Done!" onload="top.banner.savePageCoord(event,document.body,'AdminMonServer'); InitMonitor()"
  20. onbeforeunload="DiscoMonitor()" onresize="processSizeChange()" onclick="checkClick()" onkeydown="processBSP()">
  21.  
  22. <script LANGUAGE="JavaScript">
  23.  
  24. var bdH = 30; // Send Text height; must match value in #ButtonDiv style above
  25. var byM = null;
  26. var borderSz = 2; // Thin Bord is 2pixels
  27. var LUser = "";
  28. var lthLUser = 0;
  29. var MessageCount = 0;
  30. var LastMessageCount = 0;
  31. var Tid = null, OTid = null;
  32. var Ostrg = ""; // Output string
  33. var WaitMessage = false;
  34. var ReconnectEvent = false;
  35. var Hp = null; // Host Port
  36. var Pause = false;
  37.  
  38. // Capture and ignore script errors
  39.     window.onerror = wwScrErr;
  40. function wwScrErr() {
  41.     return true;
  42. }
  43.  
  44. function InitMonitor() {
  45.     Tid = null; // reset if set
  46.     // Wait until Banner page is completed loading before proceeding
  47.     if ( top.BannerLoaded == false ) {  
  48.         Tid = setTimeout("InitMonitor()",500); // Not complete, delay 500 ms. then check again
  49.         return; // exit and wait
  50.     }
  51.  
  52.     top.MainLoaded = true; // Flag that Main is now loaded
  53.     Bobj = document.body; // get BODY object
  54.     LUser = "{" + Bobj.RPMUserName + "}"; // get local user name and encluse with <>
  55.     lthLUser = LUser.length; // length of string
  56.     byM = 2*parseFloat(document.body.style.margin);
  57.     processSizeChange(); // go set Window sizes
  58.     Hp = parseInt(document.body.RPMHostPort,10);
  59.     RpmCC.Connect(document.body.RPMHostIP,Hp, "");
  60. }
  61. function processReconnect() {
  62.     Tid = null;
  63.     if ( RpmCC.IsConnected() ) {
  64.         Tid = setTimeout("processConnectionCheck()",10000); // Delay 10 secs then check connection
  65.         return;
  66.     }
  67.     RpmCC.Connect(document.body.RPMHostIP,Hp, "");
  68. }
  69.  
  70. function processConnectConfirmed() {
  71.     top.Rstatus.Pstat("Connected");
  72.     if ( Tid != null ) {
  73.         clearTimeout(Tid); // stop timeout routine
  74.     }
  75.     Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
  76.     RpmCC.OpenMessageFloodgate();
  77.       RpmCC.NetStatFunction("DiskLogStatus");            
  78.     //RpmCC.SendTextStatus(LUser + " has joined monitoring"); 
  79.     
  80.     Ostrg = "<span class='clocal'>Please Wait While Server Log is Downloaded!</span><br>";        
  81.     MessageCount = LastMessageCount = 1; // reset message counts
  82.     processOutput(); // set Output thread going
  83.     WaitMessage = true; // flag wait message being displayed
  84.     top.banner.processStartComm(); 
  85. }
  86. function processConnectionCheck() {
  87.     Tid = null;
  88.     RpmCC.SendKeepAlive("Check");
  89.     Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
  90. }
  91.  
  92. function processSizeChange() {
  93.     // Display Height and Width
  94.     bCh = document.body.clientHeight;
  95.     bCw = document.body.clientWidth;
  96.     
  97.     // Minimums
  98.     bCh = (bCh < bdH+byM+120) ? bdH+byM+120 : bCh;
  99.     bCw = (bCw < 330) ? 330 : bCw;
  100.    document.body.scroll = (bCw <= 330 || bCh <= bdH+byM+120) ? "yes" : "no";
  101.  
  102.     //PopUpContext Menu
  103.    PopUpContextSize(bCw);
  104.    
  105.    // Set Height/Widths for Chart and Button areas
  106.     MonMainBox.style.height = bCh-(bdH+byM-borderSz);
  107.     MonMainBox.style.width = bCw-byM;
  108.     StMainBox.style.top = bCh-(bdH+byM-borderSz);
  109.     StMainBox.style.width = bCw-byM;
  110.     MonTextBox.style.height = MonMainBox.style.posHeight-TitleDivSize;
  111.     MonTextBox.style.width = MonMainBox.style.posWidth-12;
  112.     MonMainBox.style.display = ""; // insure visible
  113.     StMainBox.style.display = "";
  114. }
  115.  
  116. function DiscoMonitor() {
  117.     //RpmCC.SendTextStatus(LUser + " is no longer monitoring");
  118.     if ( Tid != null ) {
  119.         clearTimeout(Tid); // stop timeout routine
  120.     }
  121.     if ( OTid != null ) {
  122.         clearTimeout(OTid); // stop timeout routine
  123.     }
  124.     top.BannerMenuShow();
  125.     RpmCC.Disconnect();
  126.     top.banner.processStopCommX();
  127. }
  128.  
  129. // Print Log
  130. var DiscStatWindow = null;
  131. function processPrintStatus() {
  132.     if ( !top.banner.IE55orBetter ) {
  133.         alert("Print requires IE 5.5/SP1 or greater. Download current, free IE update from Microsoft's web site");
  134.         return;
  135.     }
  136.     FakeBut.click();    // simulate event to call "savePageCoord(...)"
  137.     var wprop = "height="+top.banner.bCh+",width="+top.banner.bCw
  138.     wprop += ",top="+(top.banner.bY-28)+",left="+(top.banner.bX-4)+",scrollbars";
  139.     var rName = ""+Math.random(); // use Random number to get unique Window name
  140.     rName = rName.substring(2,rName.length);
  141.     DiscStatWindow = window.open("",rName,wprop);
  142.     if ( DiscStatWindow == null ) {
  143.         return;   
  144.     }
  145.     var dh = "<html><head><title>MonitorIT - Server Log Report</title>";
  146.     dh += "<link rel='stylesheet' type='text/css' href='css/rpmstyle.css'></head><body";
  147.     dh += " title='Exit to Close Window when Printing is complete'>";
  148.     dh += SrvMonWindow.innerHTML;
  149.     dh += "</body></html>";
  150.     DiscStatWindow.document.open();
  151.     DiscStatWindow.document.write(dh)
  152.     DiscStatWindow.document.close();
  153.     DiscStatWindow.focus();
  154.     DiscStatWindow.print();
  155. }
  156.  
  157. function procRcv(tlth, tstrg) {
  158.     if (tstrg != "") {
  159.         // determine type of string and set class accordingly for output style
  160.         if (tstrg.substring(0,6) == "System") {
  161.             ts = "<span class='csystem'>";
  162.         }
  163.         else if (tstrg.substring(0,7) == "Request") {
  164.             ts = "<span class='crequest'>";
  165.         }
  166.         else if (tstrg.substring(0,lthLUser) == LUser) {
  167.             ts = "<span class='clocal'>";
  168.         }
  169.         else {
  170.             ts = "<span class='cnormal'>";
  171.         }
  172.         ts += tstrg + "</span><br>"; // form complete output string
  173.         ts += Ostrg; // put new string first
  174.         Ostrg = ts; // save concatenated string
  175.         ++MessageCount; // bump message count
  176.     }
  177. }
  178.  
  179. function processPauseStatus() {
  180.     Pause = ( Pause ) ? false : true;
  181.     if ( Pause ) {
  182.        StatusPauseButtonText.innerText = " Resume";
  183.         StatusPauseImage.src = "images/apply.gif";
  184.     }
  185.     else {
  186.        StatusPauseButtonText.innerText = " Pause";
  187.         StatusPauseImage.src = "images/reset.gif";
  188.         ++MessageCount; // force update
  189.     }
  190. }
  191.  
  192. var PauseOutput = "";
  193. function processOutput() {
  194.     OTid = null; // reset
  195.     if ( ((MessageCount == LastMessageCount) && (MessageCount != 0)) || (MessageCount > 500) ) { // if no new messages, then output
  196.         var os = Ostrg; // get output string
  197.         Ostrg = ""; // reset
  198.         MessageCount = 0; // reset counts
  199.         MWobj = document.all["SrvMonWindow"]; // get monitor window object
  200.         if ( WaitMessage ) { // clear it
  201.               MWobj.innerText = "";
  202.              WaitMessage = false;
  203.             top.banner.processStopCommX();
  204.         }
  205.         if ( Pause ) {
  206.             if ((PauseOutput.length + os.length) > 200000) { //max characters in window is 200K
  207.                 if ( os.length < 200000 ) { // if new string < 200K
  208.                     os = os + PauseOutput.substr(0,100000);
  209.                 }
  210.                 else { // just most recent part of new string
  211.                     os = os.substr(0,100000);
  212.                 }
  213.                 PauseOutput = ""; // clear 
  214.             }
  215.             PauseOutput = os + PauseOutput; // save it
  216.         }        
  217.         else {
  218.             if ( PauseOutput.length > 0 ) {
  219.                os += PauseOutput;
  220.                PauseOutput = "";
  221.             }
  222.             if ((MWobj.innerHTML.length + os.length) > 200000) { //max characters in window is 200K
  223.                 if ( os.length < 200000 ) { // if new string < 100K
  224.                     os = os + MWobj.innerHTML.substr(0,100000);
  225.                 }
  226.                 else { // just most recent part of new string
  227.                     os = os.substr(0,100000);
  228.                 }
  229.                 MWobj.innerText = ""; // clear current window
  230.             }
  231.             MWobj.insertAdjacentHTML("afterBegin",os); // append to the monitor window
  232.         }
  233.         EnableClearLocal(); // enable the Clear Local button
  234.     }
  235.     LastMessageCount = MessageCount; // set to determine now new messages have arrived in last 250ms.
  236.     OTid = setTimeout("processOutput()",250); // keep Output thread going
  237. }
  238.  
  239. function ClearLocalMonitor_Click() {
  240.     MWobj = document.all["SrvMonWindow"];
  241.     MWobj.innerText = ""
  242.    //StatusPrintButton.className = "BoxButtonD"; // disable button
  243.    StatusPrintButton.disabled = "disabled"; // disable button   
  244. }
  245.  
  246. function ClearServerMonitor_Click() {
  247.     RpmCC.ClearTextStatus();
  248. }
  249.  
  250. function EnableClearLocal() {
  251.     //ButtonClearLocalMonitor.className = "BoxButton";
  252.     ButtonClearLocalMonitor.disabled = "";
  253.    //StatusPrintButton.className = "BoxButton"; // enable button
  254.    StatusPrintButton.disabled = ""; // enable button   
  255. }
  256.  
  257. function processLogEnableClick() {
  258.     if ( LogEnabled.checked ) {
  259.         if ( confirm("This is a global setting that will START writing the MonitorIt Server log data to disk.\nThe file is 'MonitoriTServer.log' and is in the '...\\MonitorIT\\Bin' folder.\n\nAre you sure you want to start writing the log data to disk?") ) {
  260.         // Enable Disk logging
  261.               RpmCC.NetStatFunction("EnableDiskLog");        
  262.         }
  263.         else {
  264.             LogEnabled.checked = "";
  265.         }
  266.     }
  267.     else {
  268.         if ( confirm("This is a global setting that will STOP writing the MonitorIt Server log data to disk.\n\nAre you sure you want to stop writing the log data to disk?") ) {
  269.         // Disable Disk logging
  270.               RpmCC.NetStatFunction("DisableDiskLog");            
  271.         }
  272.         else {
  273.             LogEnabled.checked = "checked";
  274.         }
  275.     }
  276. }
  277.  
  278. /* Process key press/down and ennable or disable SendText button accordingly */
  279. function processKKeyDown() {
  280.     /*
  281.     EmptyStrg = (event.type == "keypress") ? 0 : 1;
  282.     if ( event.keyCode == 13 ) { // if Enter key
  283.         if (event.srcElement.value.length != EmptyStrg) {
  284.             processSendTextClick(); // go process typed string
  285.         }
  286.     }
  287.     else {
  288.         if (event.keyCode == 8 && event.srcElement.value.length == EmptyStrg) {
  289.             document.all.ButtonSendText.className = "BoxButtonD";
  290.             document.all.ButtonSendText.disabled = "disabled";
  291.         }     
  292.         else {
  293.             document.all.ButtonSendText.className = "BoxButton";
  294.             document.all.ButtonSendText.disabled = "";
  295.         }
  296.     }
  297.     */
  298. }
  299.  
  300. function processSendTextClick() {
  301. /*
  302.     Sobj = document.all["InputSendText"];
  303.     if (Sobj.value != "") {
  304.         RpmCC.SendTextStatus(LUser + " " + Sobj.value);
  305.         Sobj.value = "";
  306.     }
  307.     document.all.ButtonSendText.className = "BoxButtonD";
  308.     document.all.ButtonSendText.disabled = "disabled";
  309.     Sobj.focus();
  310. */
  311. }
  312.  
  313. // Process to Toggle the Hide and Show of the Banner & Menu Frames
  314. var hideToggle = 0;
  315. var TitleDivSize = 52;
  316. function processBannerMenu() {
  317.     if ( hideToggle == 0 ) {
  318.         top.BannerMenuHide(); hideToggle = 1;   
  319.         ServerLogTitleDiv.style.display = "none"; 
  320.         TitleDivSize = 4; 
  321.         MTB_Top = 0;
  322.     }
  323.     else {
  324.         top.BannerMenuShow(); hideToggle = 0;   
  325.         ServerLogTitleDiv.style.display = "";  
  326.         TitleDivSize = 52;
  327.         MTB_Top = 48;
  328.     }   
  329.     MonTextBox.style.top = MTB_Top;
  330. }
  331.  
  332. function PopUpContextOpen() {
  333. }
  334. function PopUpContextClose() {
  335. }
  336.  
  337. </script>
  338.  
  339. <script LANGUAGE="JavaScript" FOR="RpmCC" EVENT="NetStatNotify(csArg)">
  340. <!--
  341. var wrkarr = new Array();
  342. wrkarr = csArg.split("~");
  343. if ( wrkarr[0] == "LogToDiskStatus" ) {
  344.     if ( wrkarr[1] == "1" ) {
  345.         LogEnabled.checked = "checked";
  346.     }
  347.     else {
  348.         LogEnabled.checked = "";
  349.     }
  350. }
  351. //-->
  352. </script> 
  353.  
  354. <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script>
  355.  
  356. <script LANGUAGE="JavaScript" FOR="RpmCC" EVENT="Connected()">
  357. <!--
  358. processConnectConfirmed();
  359. //-->
  360. </script>
  361.  
  362. <script
  363. LANGUAGE="JavaScript" FOR="RpmCC" EVENT="Disconnected()">
  364. <!--
  365. top.Rstatus.Pstat("Disconnected",true);
  366. if ( Tid != null ) {
  367.     clearTimeout(Tid); // stop timeout routine
  368. }
  369. Tid = setTimeout("processReconnect()",4000); // Not complete, delay 4 secs then check again
  370. //-->
  371. </script>
  372.  
  373. <script LANGUAGE="JavaScript" FOR="RpmCC" EVENT="ReceiveText(nLength, szText)">
  374. <!--
  375. procRcv(nLength, szText);
  376. //-->
  377. </script>
  378.  
  379. <script
  380. LANGUAGE="JavaScript" FOR="RpmCC" EVENT="StartCommunication()">
  381. <!--
  382.  
  383. //top.banner.processStartComm();
  384. //-->
  385. </script>
  386.  
  387. <script
  388. LANGUAGE="JavaScript" FOR="RpmCC" EVENT="StopCommunication()">
  389. <!--
  390. top.banner.processStopCommX();
  391. //-->
  392. </script> 
  393.  
  394. <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script>
  395.  
  396. <object ID="RpmCC" NAME="RpmCC" WIDTH="355" HEIGHT="150" style="display: none"
  397. CLASSID="clsid:D88C2358-FC83-11D1-BF49-00104B2D6F80"
  398. codebase="controls/RPMComm.cab#version=5,2,0,0">
  399.   <param name="_Version" value="65536">
  400.   <param name="_ExtentX" value="2646">
  401.   <param name="_ExtentY" value="1341">
  402.   <param name="_StockProps" value="0">
  403. </object>
  404.  
  405. <!-- Invisible Object to Support Simulated Click Event -->
  406. <button id="FakeBut" style="display:none" onclick="top.banner.savePageCoord(event,document.body,'AdminMonServer')">
  407. </button>
  408.  
  409. <div id="MonMainBox" style="display:none">
  410.  
  411.  <div id="ServerLogTitleDiv">
  412.  <table border="1"  borderColor="activeborder" align="left">
  413.     <tr><td borderColorDark="graytext" borderColorLight="white" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/sMonitorServerActivity.gif" align="absmiddle" height="16" width="16"> MonitorIT Server Log </td></tr>
  414.  </table>
  415.   <BR CLEAR=ALL><HR align="left">
  416.  </div>
  417.  
  418.   <div id="MonTextBox" noWrap="nowrap"><span ID="SrvMonWindow"></span></div>
  419.   
  420. </div>
  421.  
  422. <div id="StMainBox" style="display:none">
  423.  
  424.     <div align="center">
  425.        <table width="100%" border="1" cellspacing="1" cellpadding="1">
  426.     <tr>
  427.       <td width="23%" align="left" class="inputlabel"><button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames" style="cursor:hand"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td>
  428.         <td align="center" width ="54%">
  429.    <button id="ButtonClearLocalMonitor" title="Press to Clear This Local Display of the MonitorIT Server Log Only" style="width:85px; height:25px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" onclick="ClearLocalMonitor_Click();  this.disabled='disabled'" disabled><img src="images/unselectall.gif" align="absmiddle" height="15" width="14"> Clear Log</button>  <button id="StatusPrintButton" title="Print MonitorIT Server Log" onclick="if (this.bdis == '0') processPrintStatus();" bdis="0" style="width:85px; height:25px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" DISABLED><img src="images/Printer.gif" align="absmiddle" height="15" width="17"> Print</button>  <button id="StatusPauseButton" title="Pause/Resume MonitorIT Server Log" onclick="if (this.bdis == '0') processPauseStatus();" bdis="0" style="width:85px; height:25px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand"><img id="StatusPauseImage" src="images/reset.gif" align="absmiddle" height="15" width="15"><span id="StatusPauseButtonText"> Pause</span></button></td>
  430. <td width="23%" align="right"><span class="inputlabel" title="Global setting to enable/disable writing Log information to 'MonitorITServer.log' in the '...\MonitorIT\Bin' folder"><INPUT TYPE="checkbox" NAME="LogEnabled" id="LogEnabled" onclick="processLogEnableClick()" style="cursor:hand">Log To Disk </span></td></tr></table>
  431.     </div>
  432.     
  433.     <!--<center>
  434.   <fieldset style="width:80%"><legend class="inputlabel" >Send Text To MonitorIT Server</legend>
  435.      <form method="POST" name="TextToServer"  onsubmit="processSendTextClick(); return false">
  436.   
  437.      <div align="center"><button id="ButtonSendText" class="BoxButtonD" style="width:85px; height:25px" onclick="processSendTextClick()" disabled ><img src="images/apply.gif" align="absmiddle" height="16" width="16">Send Text</button>   <input type="text" name="InputSendText" id="InputSendText" onkeydown="processKKeyDown()" onkeypress="processKKeyDown()" size="60" maxLength="120"></div>
  438.  
  439.      </form>
  440.   </fieldset>
  441.    </center>-->
  442.  
  443. </div>
  444.  
  445. </body>
  446. </html>
  447.